package com.woniuxy.hrp.mapper;

import com.woniuxy.hrp.entity.PayRecord;
import com.woniuxy.hrp.provider.PayRecordSqlProvider;
import org.apache.ibatis.annotations.*;

import java.util.List;
/**
 * @Author: caojieke
 * @Date: 2022/8/29 12:07
 */
@Mapper
public interface PayRecordMapper {
    /**
     * desc:添加支付记录
     * @Author: caojieke
     * @Date: 2022/8/30 10:54
     */
    @Insert("insert into hrp_payrecord values(null,#{dateTime},#{fee},#{way},#{reservationId})")
    public void insert(PayRecord payRecord);
    /**
     * 根据id查询支付记录
     * @param id
     * @return
     */
    @Select("select * from hrp_payrecord where id=#{id}")
    public PayRecord selectById(int id);

    /**
     * 根据ReservationId查询支付记录
     * @param ReservationId
     * @return
     */
    @Select("select * from hrp_payrecord where Reservation_Id=#{ReservationId}")
    public PayRecord selectByReservationId(int ReservationId);
    /**
     * desc:按条件查询支付记录
     * @Author: caojieke
     * @Date: 2022/8/30 10:54
     */
    @SelectProvider(type = PayRecordSqlProvider.class, method = "getByCondition")
    List<PayRecord> selectByCondition(PayRecord payRecord);

    /***
     * @description: 条件查询指定患者支付记录
     * @param: patientId 患者id；payRecord 条件
     * @return: java.util.List<com.woniuxy.hrp.entity.PayRecord>
     * @author Lrw
     * @date: 2022/9/7 18:19
     */
    List<PayRecord> selectRecordsByCondition(@Param("patientId") int patientId,@Param("payRecord") PayRecord payRecord);


}
